package j2src;

import beans.VolIntroductionDaoHome;
import beans.VolIntroductionDaoRemote;
import beans.VolIntroductionDto;


public class VolIntroductionDaoDelegate {
	private VolIntroductionDaoHome volIntroductionDaoHome;
    private VolIntroductionDaoRemote volIntroductionDaoRemote;
    public VolIntroductionDaoDelegate() throws Exception {
    	initializeVolIntroductionDaoHome();
        volIntroductionDaoRemote = volIntroductionDaoHome.create();
    }
    public VolIntroductionDto getOneVolIntroduction(String volId) throws Exception{
    	return volIntroductionDaoRemote.getOneVolIntroduction(volId);
    }
	public boolean insertVolIntro(VolIntroductionDto vIDto) throws Exception{
		return volIntroductionDaoRemote.insertVolIntro(vIDto);
	}
	public boolean updateVolIntro(VolIntroductionDto vIDto) throws Exception{
		return volIntroductionDaoRemote.updateVolIntro(vIDto);
	}
    
    private void initializeVolIntroductionDaoHome() throws Exception {
        String FACADE_NAME = "VolIntroductionDaoBean";
        Class FACADE_CLASS = beans.VolIntroductionDaoHome.class;
        if (volIntroductionDaoHome == null) {
            try {
                WhiteDaoLocator locator = WhiteDaoLocator.getInstance();
                volIntroductionDaoHome = (VolIntroductionDaoHome) WhiteDaoLocator.getEjbHome(FACADE_NAME, FACADE_CLASS);
                if (volIntroductionDaoHome == null) {
                    throw new Exception("Did not get home for " + FACADE_NAME);
                }
            } catch (WhiteDaoLocatorException e) {
                throw new Exception(e.getMessage());
            }
        }
    }
}
